package com.wdhcr.osspolicy.exception;

import com.wdhcr.osspolicy.mode.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @description: 全局异常
 * @author: wdhcr
 * @dateTime: 2021/3/7 21:37
 */
@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(Exception.class)
    public R exception(Exception e) {
        return R.error(e.getMessage());
    }

}
